﻿@inherits Framework.Project.Web.Mvc.View.RazorEngine.CWebViewPage

@using System;
@using System.IO;
@using System.Web.Mvc;
@using System.Web.Mvc.Html;
@using Framework.Project.Web.Mvc;
@using AdvTicket.Common.Library;
@using AdvTicket.Admin.Web.Library;
@using DevExpress.Web.Mvc.UI;

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta name="robots" content="index,follow" />
    <meta name="description" content="@CAdvTicketAdmin.ProjectWebPageTitleName" />
    <link rel="stylesheet" type="text/css" media="screen" href="@CDataPage.GetResourcePathWithVirtualPath(CPageBase.HGOResetCss)" />
    <link rel="stylesheet" type="text/css" media="screen" href="@CDataPage.GetResourcePathWithVirtualPath(CPageBase.HGOMasterPageCss)"/>

    <!-- JQuery -->
    <script type="text/javascript" src="@CDataPage.GetResourcePathWithVirtualPath(CPageBase.JqueryScriptPath)"></script>

    <!-- HGO Framework Javascript Codes -->
    <script type="text/javascript" src="@CDataPage.GetResourcePathWithVirtualPath(CPageBase.HGOAjaxScriptPath)"></script>
    <script type="text/javascript" src="@CDataPage.GetResourcePathWithVirtualPath(CPageBase.HGOJsScriptPath)"></script>

    <!-- Icon Bilgisi.-->
    <link href="@CFrameworkResourceModule.GetUrl("icon.ico")" type="image/x-icon" rel="icon" />
    <link href="@CFrameworkResourceModule.GetUrl("icon.ico")" type="image/x-icon" rel="shortcut icon" />

    <!-- Telerik Css Theme, Framework tüm işlemleri hallediyor, Combine, Minify, Compress -->
    <!-- Bilerek Content dizini altına link verildi ki grafik dosyalarını css dosyaları düzgün görebilsin -->
    <link rel="Stylesheet" type="text/css" media="screen" href="@CPageBase.HGOTelerikStylePath" />

    <!-- Telerik Js Files, Framework tüm işlemleri hallediyor, Combine, Minify, Compress -->
    <!-- <script type="text/javascript" src="@CPageBase.GetUrlWithVirtualPath("/Scripts/HGO.axd?file=t$.js&cmp=1,2,3,4,5,6,7,11,12,13,23,24,25,26")"> </script> -->

    <!-- HGO Framework Telerik Extension -->
    <!-- <script type="text/javascript" src="HGO.axd?file=HgoTExtension.js"></script> -->

    <!-- For DevEx, Custom Methods -->
    <script type="text/javascript" src="@CDataPage.GetResourcePathWithVirtualPath(CPageBase.HGODxExtensionScript)"> </script>

    <script type="text/javascript">
      function onLoadCall()
      {
        // When Click Navigation tabs...
        $('#main-nav > li > a').click(
                                        function () {
                                          $(this).parent().siblings().children("a").removeClass('current'); // Remove .current class from all tabs
                                          $(this).addClass('current'); // Add class .current
                                          $(this).parent().siblings().children("ul").fadeOut(100); // Hide all subnavigation
                                          $(this).parent().children("ul").fadeIn(100); // Show current subnavigation
                                        }
                                      );

        // When Behaivour Sub Menu Click...
        $('#main-nav > li > ul > li > a').click( function () {
                                                    $('#main-nav > li > ul > li > a').removeClass('current');
                                                    $(this).addClass('current');

                                                    //document.getElementById('locPanel').innerHTML = 'Location: ' + $(this).text();
                                                    $('#locPanel').html('@CPageBase.GetLabelFromDB(CAdvTicketAdmin.VirtualPath, "Active Page: ")' + $(this).text());
                                                  }
                                                );
      };

      function selectMenu()
      {
        var shortUrlId = '#' + location.pathname;
        shortUrlId = shortUrlId.replaceAll("/", "-");

        //selectMainMenu...
        // $('#main-nav > li > ul').hide(); // Hide all subnavigation
        //$(shortUrlId).parent().parent().parent().siblings().children("a").removeClass('current'); // Remove MainMenu Class
        //$(shortUrlId).parent().parent().parent().children("a").addClass('current');
        $('#main-nav > li > a.current').parent().children("ul").show(); // Show current subnavigation

        // selectSubMenu...
        //$('#main-nav > li > ul > li > a').removeClass('current');
        //$(shortUrlId).addClass('current');

        //$('#locPanel').html('Location: ' + $(shortUrlId).text());
      }
    </script>
  </head>
<body onload=" selectMenu(); onLoadCall()">

    @{
      var urlPath = CHttpApplication.Current.Request.Url;
      
      int i = 0;
      int x = 0;
      bool exist;
      string location = "";
      string urlWithVirtualPath = (CPageBase.GetUrlWithVirtualPath(base.Model.urlWithOutVirtualPath));
      bool isMultiLanguage = CHttpApplication.Current.MultiLanguageEnabled;      
      
      foreach (var item in CHttpApplication.Current.ProjectAdapter.ProjectInfo.ArrivalTrees.List)
      {
        if (item.TreeGroupName == CAdvTicketAdmin.VirtualPath)
        {
          foreach (var subitem in item.Items)
          {
            if (urlWithVirtualPath == subitem.SeoLink)
            {
              location = isMultiLanguage ? CPageBase.GetLabelFromDB(CAdvTicketAdmin.VirtualPath, subitem.Caption) : subitem.Caption;
            }
          }           
        }
      }
     }

  <div id="masterheader">
    <div id="headerlogo"> 
      <img src="@CDataPage.GetResourceUrl("AdvTicket_Admin_Panel.png")" alt="AdvTicket Logo" />

      <div id="headerrightpanel">
        <label class="white">Logged UserName: @CHttpApplication.Current.ProjectAdapter.UserInfo.Name </label>  
        <label multilngdisabled = "multilngdisabled"> &nbsp; | &nbsp; </label>
        <label class="white" id="locPanel" >Active Page: @location</label>
        <label multilngdisabled = "multilngdisabled"> &nbsp; | &nbsp; </label>
        <label class="whitelink" onclick="@CPageBase.GetLogOutScript();">LogOut</label>
      </div>
    </div>

    <!-- Main Tab Menu -->
    <ul id="main-nav">
    @{
      foreach (var item in CHttpApplication.Current.ProjectAdapter.ProjectInfo.ArrivalTrees.List)
      {
        exist = false;
        i++;
        if (item.TreeGroupName == CAdvTicketAdmin.VirtualPath)
        {
            <li>
              <!-- class="current" kaldırıldı, yansıma yapıyor... -->
              @foreach (var subitemtmp in item.Items)
              {
                if (urlWithVirtualPath == subitemtmp.SeoLink)
                {
                  exist = true;
                  break;
                }
              }

              @if (exist)
              {
                <a class="current">
                  @item.Caption
                </a>
              }
              else
              {
                <a>
                  @item.Caption
                </a>
              }

              @if (item.Items.Count > 0)
              {
                x++;
						    <ul style="display: none;">
                @foreach (var subitem in item.Items)
                {
							      <li>
                      @if (urlWithVirtualPath == subitem.SeoLink)
                      {
                        <a href="@CPageBase.GetJoiningUrl(CPageBase.GetUrlBasePath(), subitem.SeoLink)" class="current" id="@subitem.SeoLink.Replace('/', '-')" >
                            @if (subitem.ImageInfo != null)
                            {
                              <img src="@{ base.Write(CPageBase.GetJoiningUrl(CPageBase.GetUrlBasePath(), CPageBase.GetUrlWithVirtualPath("/"))  + CFrameworkResourceModule.GetUrl(subitem.ImageInfo.Caption)); }" width="18px" height="18px" />
                            }
                            <label id="mainmenusubitem" onclick = " if (PageMethods.isIE) { document.location.href = '@CPageBase.GetJoiningUrl(CPageBase.GetUrlBasePath(), subitem.SeoLink)'};" >@subitem.Caption</label>
                        </a>
                      }
                      else
                      {
                        <a href="@CPageBase.GetJoiningUrl(CPageBase.GetUrlBasePath(), subitem.SeoLink)" id="@subitem.SeoLink.Replace('/', '-')" >
                            @if (subitem.ImageInfo != null)
                            {
                              <img src="@{ base.Write(CPageBase.GetJoiningUrl(CPageBase.GetUrlBasePath(), CPageBase.GetUrlWithVirtualPath("/"))  + CFrameworkResourceModule.GetUrl(subitem.ImageInfo.Caption)); } " width="18px" height="18px" />
                            }
                            <label id="mainmenusubitem2" onclick = " if (PageMethods.isIE) { document.location.href = '@CPageBase.GetJoiningUrl(CPageBase.GetUrlBasePath(), subitem.SeoLink)'};" >@subitem.Caption</label>
                        </a>
                      }

                    </li>
                    <div id="space"></div>
                }
						    </ul>
              }
            </li>
        }
      }
      }
    </ul>

    <!-- Content Page için aşağıdaki Div elementini eklemek yeterli, 
         id değeri "contentPage" olmalı. 
         1- ScrollBar otomatik açılması için overflow: auto olması lazım.
         2- Bu MasterPage için width ve height değeri olması gerekiyor. İç Window'un düzgün taşınması için gerekli.
         -->
    <div id="renderBody" style="top: 120px; left: 20px; overflow: auto; width:97%; height: 75%; position: absolute; ">
    </div>

    <div id="masterfooter">
      <label multilngdisabled = "multilngdisabled"> @(CAdvTicketAdmin.ProjectWebPageTitleName) | Powered By </label>
      <a style="margin-left: 3px" target="_blank" href="http://www.advticket.com" multilngdisabled = "multilngdisabled">AdvTicket</a> 
    </div>
    <div id ="masterfooterbottom"> </div>

  </div>

</body>
</html>

